import os, base64
import logging


class Config(object):
    """配置信息"""

    # mysql配置
    SQLALCHEMY_DATABASE_URI = "mysql://root:123456@127.0.0.1:3306/xj_info"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # redis配置
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = "6379"

    # 配置秘钥
    # secret_str = base64.b64encode(os.urandom(32))
    SECRET_KEY = "yaoguang"

    # 配置session
    SESSION_TYPE = "redis"
    SESSION_USE_SIGNER = True

class DevelopmentConfig(Config):
    DEBUG = True
    LOG_LEVEL= logging.DEBUG

class ProductionConfig(Config):
    DEBUG = False
    LOG_LEVEL = logging.ERROR

